# Maintainer: Willow Barraco <contact@willowbarraco.fr>
pkgname=mcron
pkgver=1.0.0
pkgrel=0
pkgdesc="A cron implementation for mobile phones"
url="https://sr.ht/~stacyharper/mcron/"
install="$pkgname.pre-install"
arch="x86_64 aarch64 riscv64" # hare
license="GPL-3.0-or-later"
makedepends="hare hare-ev scdoc tzdata"
subpackages="$pkgname-openrc $pkgname-doc"
source="
	$pkgname-v$pkgver.tar.gz::https://git.sr.ht/~stacyharper/mcron/archive/$pkgver.tar.gz
	mcron.initd
	mcron.confd
	"

build() {
	# Don't use user's global Hare cache
	export HARECACHE="$srcdir"/hare-cache

	make -j1 PREFIX=/usr
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr install
	install -Dm755 "$srcdir"/mcron.initd "$pkgdir"/etc/init.d/mcron
	install -Dm644 "$srcdir"/mcron.confd "$pkgdir"/etc/conf.d/mcron
}

sha512sums="
79df0f2a8208f1e45769723ce21d4c35d4d6207ad1b3d471679a115a05a1f89a7eb06ac71e163642a07977c6b341c03e30a0311d6ed773b143e2de68d770481d  mcron-v1.0.0.tar.gz
21d970a4a6c669fef6f4f40b924da4f90d984a50d414285c7bad528cae7c55f05f0427ceb83ffc3046dd091d33e13e1e54d4f698005ee6907056daafb54cdf07  mcron.initd
40f63236b205a32d5e7caf31b111e290d10e4b3df78cedfb1194377aa57e736a3f64e0e27f39423ec515961011e90d81ce2ff39bc34147bbaa46e7c40449ca0c  mcron.confd
"
